package Reseau;

import java.io.IOException;
import java.net.Socket;

import IHM.pPartie;

public class FluxEnvoi extends FluxdeString implements Runnable{

	Socket socket;
	String message;
	pPartie ppartie;
	public FluxEnvoi(Socket socket,String message,pPartie ppartie){
		this.socket = socket;
		this.message=message;
		this.ppartie=ppartie;
		new Thread(this).start();
	}
	public void run() {
		try {
			super.envoi(socket, message);
			if(message.split("//",2)[0].equals("CHAT"))ppartie.afficherMessageln("Moi : "+message.split("//",2)[1]);
		} catch (IOException e) {
			e.printStackTrace();
		}
		
	}

}
